Embodiments of the inventive subject matter generally relate to the field of memory management and, more particularly, to management of low paging space conditions in an operating system.
Operating systems implement memory management by virtualizing memory units of a computer (e.g., random access memory (RAM), hard disk space, external memory units, etc.) to enable a program to access the memory units as if there was only one hardware memory unit. A virtual memory manager of the operating system maintains a subset of the hard disk space for temporarily storing content for which physical memory (i.e., the RAM) is not available. This subset of the hard disk space is also known as paging space. The virtual memory manager swaps content from the physical memory to the paging space when not in use and swaps the content from the paging space back into the physical memory when in use. The content is typically read to or written from the paging space in the form of blocks of contiguous paging space also called pages. Such a memory management technique (also referred to as virtual memory management) allows total memory content of processes executing on the computer to exceed the total physical memory and allows the processes to use the physical memory only when the processes execute. Typically, the operating system attempts to free up (or de-allocate) pages from the processes before all the available pages can be allocated and before the operating system can run out of available memory to avoid deadlocks that cause the operating system to freeze/crash. For example, the operating system can terminate a process to which a large number of pages are allocated, to maintain operating system stability.